package com.lenovo.smarttraffic.ui.fragment;

import android.os.Bundle;
import android.os.SystemClock;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.View;
import android.widget.ListView;

import com.lenovo.smarttraffic.R;

import java.util.ArrayList;


public class ThirdFragment extends BaseFragment {
    private String firsttab;
    private ListView lv_fg3;
    private SwipeRefreshLayout swipeRefreshLayout_fg3;

    @Override
    protected View getSuccessView() {
        Bundle bundle = getArguments();
        if (bundle != null) {
            firsttab = bundle.getString("ThirdFragment");
        } else {
            firsttab = "";
        }
        View view = View.inflate(getActivity(), R.layout.fragment_thrid, null);
        initView(view);
        return view;
    }

    private void initView(View view) {
        lv_fg3 = view.findViewById(R.id.lv_fg3);
        swipeRefreshLayout_fg3 = view.findViewById(R.id.swipeRefreshLayout_fg3);
    }

    @Override
    protected Object requestData() {
        SystemClock.sleep(1000);/*模拟请求服务器的延时过程*/
        return new ArrayList<>();/*空*/
    }

    @Override
    public void onClick(View view) {

    }

    public static ThirdFragment onNewBundle(String args) {
        ThirdFragment thirdFragment = new ThirdFragment();
        Bundle bundle = new Bundle();
        bundle.putString("ThirdFragment", args);
        thirdFragment.setArguments(bundle);
        return thirdFragment;
    }
}
